﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TransportLayer.NodeToolsLibrary;


namespace TransportLayer.NodeLibrary
{
    public enum ProtocolUnitType {NORMAL_PACKET,ERROR_PACKET, CONF_PACKET }

    public class ProtocolUnit
    {
        private int stream;
        public int Stream { get { return stream; } set { stream = value; } }
        private int size;
        public int Size { get { return size; } }
        private string message;
        public string Message { get { return message; } set { message = value; size = message.Length; } }
        private ProtocolUnitType put;
        public ProtocolUnitType Put { get { return put; } set { put = value; } }


        public ProtocolUnit()
        {}

        public ProtocolUnit(int stream, string message)
        {
          ProtocolUnitType put = ProtocolUnitType.NORMAL_PACKET;
          this.Stream = stream;
          this.message = message;
 
        }
        public override string ToString()
        {
           
            return this.GetType() +"\nID " + Stream + "\nSize " + Size + "\nMessage " + message;
        }


        private string GetType() 
        {
            return put.ToString();
        }

    }
}
